<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>班级管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/teach/teachClass/">班级列表</a></li>
		<shiro:hasPermission name="teach:teachClass:edit"><li><a href="${ctx}/teach/teachClass/form">班级添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="teachClass" action="${ctx}/teach/teachClass/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>班级名称：</label>
				<form:input path="className" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>班主任名称：</label>
				<%--<form:input path="className" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
				<%--<form:select path="user.id" class="input-medium">--%>
					<%--<form:option value="" label=""/>--%>
					<%--<form:options items="${fns:getDictList('')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
				<%--</form:select>--%>
				<select id="userId" name="userId" class="input-medium">
					<option value="" selected>====请选择====</option>
					<option value="0">无</option>
					<c:forEach items="${allTeacherList}" var="allTeacher">
						<option value="${allTeacher.id}" >${allTeacher.name}</option>
					</c:forEach>
				</select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<%--增加新建班级按钮--%>
			<%--<shiro:hasPermission name="teach:teachClass:edit"><li><a href="${ctx}/teach/teachClass/form">班级添加</a></li></shiro:hasPermission>--%>
			<%--<li class="btns"><input id="btnSubmit1" class="btn btn-primary" type="submit" value="新建班级"/></li>--%>
			<%--<shiro:hasPermission name="teach:teachClass:edit"><li class="btns"><input id="btnSubmit1" class="btn btn-primary" type="submit" href="${ctx}/teach/teachClass/form" value="新建班级"/></li></shiro:hasPermission>--%>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>班级名称</th>
				<th>班主任名称</th>
				<shiro:hasPermission name="teach:teachClass:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="teachClass">
			<tr>
				<%--<td><a href="${ctx}/teach/teachClass/form?id=${teachClass.id}">--%>
					<td><a href="${ctx}/teach/teachClass/detail?id=${teachClass.id}&&teacherName=${teachClass.userId}">
					${teachClass.className}
				</a></td>
				<td>
					${teachClass.userId}
					<%--${teachClass.user_id}--%>
				</td>
				<shiro:hasPermission name="teach:teachClass:edit"><td>
    				<%--<a href="${ctx}/teach/teachClass/form?id=${teachClass.id}">修改</a>--%>
				<a href="${ctx}/teach/teachClass/delete?id=${teachClass.id}" onclick="return confirmx('确认要删除该班级管理吗？', this.href)">删除</a>
				<a href="${ctx}/teach/teachClass/copyClassForm?id=${teachClass.id}">修改</a>
				<a href="${ctx}/teach/teachClass/copyClassForm?id=${teachClass.id}&type=copy">复制</a>
				<%--<a href="${ctx}/teach/teachClass/copyClassForm?id=${teachClass.id}">修改</a>--%>
					<a href="${ctx}/teach/teachClass/detail?id=${teachClass.id}&&teacherName=${teachClass.userId}">查看详情</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>